﻿using Susha.Models;
using Susha.Models.Helpers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Susha.Areas.Admin.Models.Requests
{
    public class SushiCreate
    {
        public Int32 Id { get; set; }
        public String Name { get; set; }
        public Int32 Price { get; set; }
        public String SmallPhoto { get; set; }
        public Int32 ParentCategory { get; set; }

        public Sushi Convert2Sushi()
        {
            return new Sushi()
            {
                Id = this.Id,
                Name = this.Name,
                Price = this.Price,
                SmallPhoto = this.SmallPhoto,
                ParentCategory = CategoryRepository.GetCategoryById(this.ParentCategory)
            };
        }
    }
}